Loading...
 

MATLAB implementation of the generation of basis functions based on the knot vector

Below you can find a link to the MATLAB code that calculates and draws B-spline basis functions based on a given node vector.

The code execution is also possible in the free Octave(external link) environment.
Download(external link) or see Appendix 2.

After installing Octave, open the code.
The running of the code starts with the spline () precedent which sets the example vector of knot_vector = [1,1,1,2,3,3,4,5,6,7,7,7] then calculates the number of basis functions using the compute_nr_basis_functions () procedure, and calculates the degree of basis functions (homogeneous for the whole vector of nodes) using the compute_p procedure, and the vector of x points where basis functions will be counted using the mesh () procedure.
The code generates the values of the underlying functions at these points using compute_spline () and then draws the functions using the plot command in a loop. It is possible to modify the node vector in order to generate different bases.

Content of exercise:
Please generate a vector of nodes that generates a base equivalent to the Lagrange basis of polynomials of the first order on two elements [0,1] and [1,2]. Please run MATLAB code and draw base functions.
Content of exercise:
Please generate a vector of nodes that generates a base equivalent to the Lagrange base of polynomials of the fourth degree on five elements [0,1] and [1,2] and [2,3] and [3,4] and [4,5]. Please run MATLAB code and draw base functions.
Content of exercise:
Please generate a vector of nodes that generates the base of B-spline polynomials of the third order with C2 continuity spread over three elements [0,0.1] and [0.1,0.9] and [0.9 1]. Please run MATLAB code and draw base functions.
Content of exercise:
Please generate a vector of nodes that generates a base of B-spline polynomials of the third order with continuity C1 spread over four elements [0,1] and [1,2] and [2,3] and [3,4]. Please run MATLAB code and draw base functions.
Content of exercise:
Please modify the code so that it draws two-dimensional B-splines on the area resulting from the tensor product of two node vectors. Please use MATLAB's meshgrid or surf function. Run the MATLAB code for the node vectors [0 0 0 0 1 2 3 4 4 4 4] x [0 0 1 2 3 4 4] and draw the base functions.

Ostatnio zmieniona Wtorek 09 z Listopad, 2021 12:18:42 UTC Autor: Maciej Paszynski
Zaloguj się/Zarejestruj w OPEN AGH e-podręczniki
Czy masz już hasło?

Hasło powinno mieć przynajmniej 8 znaków, litery i cyfry oraz co najmniej jeden znak specjalny.

Przypominanie hasła

Wprowadź swój adres e-mail, abyśmy mogli przesłać Ci informację o nowym haśle.
Dziękujemy za rejestrację!
Na wskazany w rejestracji adres został wysłany e-mail z linkiem aktywacyjnym.
Wprowadzone hasło/login są błędne.